package com.yssoft.entity.core;

import com.yssoft.entity.CommonEntity;

import java.util.List;
import java.util.Objects;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 区域表实体类
 * t_area
 * @author yuxingda
 */
@Table(name="t_area")
public class TArea {
    /**
     * 主键
     */
    @Id
    private Integer id;
    /**
     * 删除flag
     */
    private Integer delete_flag;
    /**
     * 上级区域
     */
    private Integer t_a_id;

    /**
     * 名称
     */
    private String name;

    /**
     * 编码
     */
    private String code;

    /**
     * 子区域集合
     */
    @Transient
    private List<TArea> childrenList;
    
    private static final long serialVersionUID = 1L;

    public Integer getId() {
        //return Integer.valueOf(code);
    	return  id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getDelete_flag() {
        return delete_flag;
    }

    public void setDelete_flag(Integer delete_flag) {
        this.delete_flag = delete_flag;
    }

    public Integer getT_a_id() {
        return t_a_id;
    }

    public void setT_a_id(Integer t_a_id) {
        this.t_a_id = t_a_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public List<TArea> getChildrenList() {
        return childrenList;
    }

    public void setChildrenList(List<TArea> childrenList) {
        this.childrenList = childrenList;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof TArea)) return false;
        TArea area = (TArea) o;
        return Objects.equals(id, area.id) &&
                Objects.equals(delete_flag, area.delete_flag) &&
                Objects.equals(t_a_id, area.t_a_id) &&
                Objects.equals(name, area.name) &&
                Objects.equals(code, area.code) &&
                Objects.equals(childrenList, area.childrenList);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, delete_flag, t_a_id, name, code, childrenList);
    }

    @Override
    public String toString() {
        return "TArea{" +
                "id=" + id +
                ", delete_flag=" + delete_flag +
                ", t_a_id=" + t_a_id +
                ", name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", childrenList=" + childrenList +
                '}';
    }
}